{include file="../view/head" /}
<style>
    #user_list .panel-heading>form{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-right: 40px;
    }
    #user_list .panel-heading>form>div>label{
        width: 100%;
        background: #666;
        color: #fff;
        border-radius: 4px 4px 0 0;
        border: 1px solid #666;
        margin: 0;
        text-align: center;
    }
    #user_list .panel-heading>form>div>.form-control{
        border-radius: 0 0 4px 4px;
        border: 1px solid #666;
        padding: 0;
        height: auto;
    }
    td>.btn{font-weight: normal;}
</style>
</head>
<body>
    
    {include file="../view/header" /}
    {include file="../view/sidebar" /}
    {include file="../view/right-sidebar" /}
    <!-- Start #content -->
    <div id="content">
        <!-- Start .content-wrapper -->
        <div class="content-wrapper">
            <div class="row">
                <!-- Start .row -->
                <!-- Start .page-header -->
                <div class="col-lg-12 heading hidden-xs hidden-sm">
                    <!-- Start .bredcrumb -->
                    <ul id="crumb" class="breadcrumb"></ul>
                    <!-- End .breadcrumb -->
                </div>
                <!-- End .page-header -->
            </div>
            <!-- End .row -->
            <div class="outlet">
                <!-- Start .outlet -->
                <!-- Page start here ( usual with .row ) -->
                <div class="row">
                    <div class="col-md-12" id="user_list">
                        <!-- col-lg-12 start here -->
                        <div class="panel panel-default toggle panelRefresh">
                            <!-- Start .panel -->
                            <div class="panel-heading" style="padding: 10px 15px;">
                                <form action="{:url('users/getnextree')}" method="get" style="width: 300px">
                                    {:token()}
                                    <div style="width:110px;">
                                        <label>搜索用户</label>
                                        <input class="form-control" type="number" name="uname" value="{$param.uname?:''}" oninput="if(value.length>11)value=value.slice(0,11)">
                                    </div>
                                    <button type="submit" class="btn btn-primary">搜索</button>
                                </form>

                            </div>
                            <div class="panel-body">
                                <div class="col-md-12 margin-bottom-20" style="color:#ccc">
                                    {$data}
                                </div>
                                
                        </div>
                    </div>
                </div>
                <!-- Page End here -->
            </div>
            <!-- End .outlet -->
        </div>
        <!-- End .content-wrapper -->
        <div class="clearfix"></div>
    </div>
    
    <!-- End #content -->
    {include file="../view/foot" /}
    <script>
    
      function findtree(userid,url)
      {
          
        var nextree=$('#nextree_'+userid);
        var treeimg=$('#tree_'+userid);
        if(nextree.css('display')=='none')
        {
            nextree.css('display','block');
            if(treeimg.attr('src')=='/public/admin/wangluotu/tree_minus.gif')
            {
              treeimg.attr('src','/public/admin/wangluotu/tree_minusl.gif');
            }
            else
            {
              treeimg.attr('src','/public/admin/wangluotu/tree_minus.gif'); 
            }
             nextree.html('载入中.........');
           }
        else
        {
            nextree.css('display','none');  
             if(treeimg.attr('src')=='/public/admin/wangluotu/tree_minus.gif')
             {
                   treeimg.attr('src','/public/admin/wangluotu/tree_plus.gif');
             }
             else
             {
                   treeimg.attr('src','/public/admin/wangluotu/tree_minus.gif'); 
             }
     
           }
        $.ajax({
            url:url,
            type:"post",
            dataType:"json",
            data:{id:userid},
            success:function(res){
                console.log(res);
                
                if(res.result)
                   {
                     nextree.html(res.html);
                   }
                   else
                   {
                     nextree.html('获取失败');
                   }
            }
        });
           
    }
</script>
</body>
</html>